From: Carlos Garnacho Date: Thu, 6 Nov 2025 13:37:06 +0000 (+0100) Subject: messageList: Recognize URLHighlighter gesture only if clicking on an URL X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~105 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8f2598e9fe153ee512667052908e63c3409090bc;p=gnome-shell.git messageList: Recognize URLHighlighter gesture only if clicking on an URL Otherwise it would still consume the press+release, making the overall notification unable to handle activation. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8799 Part-of: --- diff --git a/js/ui/messageList.js b/js/ui/messageList.js index deed5eb02..85fc044d3 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -56,10 +56,18 @@ class URLHighlighter extends St.Label { this.setMarkup(text, allowMarkup); this._clickGesture = new Clutter.ClickGesture(); - this._clickGesture.connect('recognize', this._onClick.bind(this)); + this._clickGesture.connectObject( + 'recognize', this._onClick.bind(this), + 'may-recognize', this._checkInUrl.bind(this)); this.add_action(this._clickGesture); } + _checkInUrl() { + const {x, y} = this._clickGesture.get_coords_abs(); + const urlId = this._findUrlAtPos(x, y); + return urlId !== -1; + } + _onClick() { const {x, y} = this._clickGesture.get_coords_abs(); const urlId = this._findUrlAtPos(x, y);